package com.gadgets.busi.bm03;

import com.alibaba.fastjson.JSON;

import java.lang.reflect.Type;

/**
 * @author UncleXiu
 * @version V1.0.0
 * @data 2021-10-22
 */
public class TestDemp {

    public static void main(String[] args) throws ClassNotFoundException {
        int i = 1;
        double j = 1d;
        long k = 2;
        boolean m = true;
        String s1 = JSON.toJSONString(i);
        String s2 = JSON.toJSONString(j);
        String s3 = JSON.toJSONString(k);
        String s4 = JSON.toJSONString(m);


        Class c1 = Class.forName("java.lang.Integer");
        Class c2 = Class.forName("java.lang.Double");
        Class c3 = Class.forName("java.lang.Long");
        Class c4 = Class.forName("java.lang.Boolean");

        Class c5 = boolean.class;

        int i1 = JSON.parseObject(s1, (Type) c1);
        double j1 = JSON.parseObject(s2, (Type) c2);
        long k1 = JSON.parseObject(s3, (Type) c3);
        boolean m1 = JSON.parseObject(s4, (Type) c4);
        boolean m2 = JSON.parseObject(s4, (Type) c5);

        System.out.println("Test");

    }

}
